package com.example.flink.controller;

import com.example.flink.LogEvent;
import com.example.flink.service.KafkaProducerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/log")
public class LogController {
    @Autowired
    private KafkaProducerService kafkaProducerService;

    @PostMapping("/event")
    public String logEvent(@RequestBody LogEvent logEvent) {
        kafkaProducerService.sendLog(logEvent);
        return "ok";
    }
} 